
#include "StdAfx.h"
#include "NetServiceOrder.h"

NetServiceOrder::NetServiceOrder(){
	reset();
}

NetServiceOrder::~NetServiceOrder(){
}

void NetServiceOrder::reset(){
	order_type_ = 0;
	memset( buffer_, 0, sizeof( char ) * DEF_MAX_BUFFER );
	size_ = 0;
}

bool NetServiceOrder::is_broadcast_order(){
	if( order_type_ == DEF_ORDER_BROADCAST )
		return true;
	return false;
}

char* NetServiceOrder::get_buffer(){
	return buffer_;
}

int NetServiceOrder::get_buffer_size(){
	return size_;
}

void NetServiceOrder::order_broadcast( char* buffer, int size ){
	if(! buffer )
		return;

	if( size >= DEF_MAX_BUFFER )
		return;

	order_type_ = DEF_ORDER_BROADCAST;
	memcpy( buffer_, buffer, sizeof( char ) * size );
	size_ = size;
}
